package com.cstor.liang.pojo.other;

/**
 * Created by Administrator on 2017/8/31.
 */
public class ResultJo {

    private int code;
    private String message;
    private Object data;

    public static ResultJo returnOk(Object data) {
        ResultJo resultJo = new ResultJo();
        resultJo.setCode(0);
        resultJo.setData(data);
        return resultJo;
    }

    public static ResultJo returnOk(String message) {
        ResultJo resultJo = new ResultJo();
        resultJo.setCode(0);
        resultJo.setMessage(message);
        return resultJo;
    }

    public static ResultJo returnError(int code, String message) {
        ResultJo resultJo = new ResultJo();
        resultJo.setCode(code);
        resultJo.setMessage(message);
        return resultJo;
    }

    public ResultJo() {
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
